<template>
	<view class="container">
<!-- 		<view class="tui-order-header">
			<view class="tui-text">订单编号：
				<text class="tui-bold">9136257866</text>
			</view>
			<view class="tui-text">国内承运人：华南众包站</view>
			<view class="tui-text">预计送达：
				<text class="tui-bold">5</text>月<text class="tui-bold">1</text>日</view>
		</view> -->
		<view class="tui-order-tracking">
			<tui-time-axis>
				<template v-for="(item,index) in dataList">
					<tui-timeaxis-item backgroundColor="transparent">
					<template v-slot:node>
						<view class="tui-node" :style="{backgroundColor:'#999'}">
							<tui-icon :name="icons[item.type]" color="#fff" :size="14" :bold="true"></tui-icon>
						</view>
					</template>
					<template v-slot:content>
						<view>
							<view class="tui-order-title">{{item.title}}</view>
							<view class="tui-order-desc">{{item.content}}</view>
							<view class="tui-order-time tui-gray">{{item.create_time}}</view>
						</view>
					</template>
				</tui-timeaxis-item>
				</template>
				
			</tui-time-axis>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
               backgroundColor:"#5677fc",
			   icons:['applets','applets','category','cart','friendadd-fill','feedback','card','unreceive'],
			   dataList:[],
			   page:1,
			   last_page:2,
			   mid:0,
			}
		},
		onLoad(opt){
			this.mid =opt.mid;
		},
		onShow(){
			this.getData();
		},
		methods: {
			getData() {
				if(this.page > this.last_page){return false;}
				this.tui.get('user/api/actions',{mid:this.mid,page:this.page}).then(res=>{
					this.page++
					this.last_page = res.data.last_page;
					this.dataList = [...this.dataList,...res.data.data];
				})
			}
		},
		onReachBottom: function() {
			this.getData();
		}
	}
</script>

<style>
	.tui-order-header {
		padding: 30rpx;
		box-sizing: border-box;
		background: #fff;
	}

	.tui-text {
		font-size: 28rpx;
		color: #333;
		padding: 4rpx;
	}

	.tui-bold {
		font-weight: bold;
	}

	.tui-node {
		height: 44rpx;
		width: 44rpx;
		border-radius: 50%;
		background-color: #ddd;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #fff;
		flex-shrink: 0;
	}

	.tui-node-dot {
		height: 16rpx;
		width: 16rpx;
		background-color: #ddd;
		border-radius: 50%;
		/* transform: translateY(45%); */
		margin-top: 6rpx;
	}

	.tui-bg-primary {
		background: #EB0909 !important;
	}

	.tui-order-tracking {
		padding: 30rpx 30rpx 30rpx 40rpx;
		background: #fff;
		margin-top: 20rpx;
		box-sizing: border-box;
	}

	.tui-order-title {
		padding-bottom: 12rpx;
		font-size: 32rpx;
		color: #333;
		font-weight: bold;
	}

	.tui-order-desc {
		padding-bottom: 12rpx;
		font-size: 28rpx;
		color: #333;
	}

	.tui-ptop {
		display: flex;
		justify-content: flex-start;
		line-height: 28rpx;
	}

	.tui-order-time {
		font-size: 24rpx;
		font-weight: bold;
	}

	.tui-gray {
		color: #848484 !important;
	}

	.tui-light-gray {
		color: #888 !important;
	}

	.tui-primary {
		color: #5677fc;
	}
</style>
